import Vuex from 'vuex'
Vue.use(Vuex)
// modules引入只需要modules下添加js文件
const modules = {}
let files = require.context('./modules', false, /.js$/)
files.keys().forEach((key) => {
  let name = key.replace(/\.\/((\d|\D)+)\.js/g, '$1')
  modules[name] = files(key)?.default
})
export default new Vuex.Store({
  modules
});
